﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntityModel;

namespace GUIServerConnectorAPI
{
    /// <summary>
    /// The IServerInterface provides specific functionalities for specific user roles. This interface shall
    /// be used only by users with non-MANAGER role, only for the purpose of achieving the functionality
    /// specific for a given user role.
    /// </summary>
    public interface IServerInterface
    {
        /// <summary>
        /// Used by the pacient to acquire it's own data
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The Pacient object containing pacient data</returns>
        Pacient getPacientData(Guid sessionId);

        /// <summary>
        /// Used by the doctor, caregiver and superviser to acquire data for a specific pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom data should be retrieved</param>
        /// <returns>The Pacient object containing pacient data</returns>
        Pacient getPacientData(Guid sessionId, Guid pacientId);

        /// <summary>
        /// Used by the doctor, caregiver and superviser to acquire data for it's associated pacients
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of Pacient objects associated with the doctor, caregiver or superviser</returns>
        List<Pacient> getPacientsData(Guid sessionId);//utilizat pt supraveghetor si medic,pt a genera lista cu toti pacientii

        /// <summary>
        /// Used by the pacient to update it's own data
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientData">The Pacient object containing the new data</param>
        void updatePacientData(Guid sessionId, Pacient pacientData);

        /// <summary>
        /// Used by the pacient to acquire data for it's associated doctors
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of Medic objects associated with the pacient</returns>
        List<Medic> getMedicsData(Guid sessionId);//utilizat pt afisare lista medici pt pacient in PacientForm

        /// <summary>
        /// Used by the pacient, doctor, caregiver or superviser to acquire the list of sensor definitions
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of DefinitieSenzori objects</returns>
        List<DefinitieSenzori> getSensorDefinitions(Guid sessionId);

        /// <summary>
        /// Used by the pacient to acquire it's own latest sensor data
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of ValoriSensori objects containing the latest sensor data available</returns>
        List<ValoriSensori> getSensorData(Guid sessionId);

        /// <summary>
        /// Used by the pacient to acquire it's own latest sensor data for specific sensor types
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="sensorTypes">The list of sensor types for which sensor data should be retrieved</param>
        /// <returns>The list of ValoriSensori objects containing the latest sensor data available for the specified sensor types</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, List<DefinitieSenzori> sensorTypes);

        /// <summary>
        /// Used by the pacient to acquire it's own sensor data in a specific interval
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="intervalStart">The date from which sensor data should be retrieved (inclusive)</param>
        /// <param name="intervalEnd">The date up to which sensor data should be retrieved (exclusive)</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified time interval</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, DateTime intervalStart, DateTime intervalEnd);

        /// <summary>
        /// Used by the pacient to acquire it's own sensor data in a specific interval for specific sensor types
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="sensorTypes">The list of sensor types for which sensor data should be retrieved</param>
        /// <param name="intervalStart">The date from which sensor data should be retrieved (inclusive)</param>
        /// <param name="intervalEnd">The date up to which sensor data should be retrieved (exclusive). If this parameter is null, it will be evaluated to DateTime.Now</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified time interval and sensor types</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, List<DefinitieSenzori> sensorTypes, DateTime intervalStart, DateTime intervalEnd);

        /// <summary>
        /// Used by the doctor, caregiver or superviser to acquire sensor data for a specific pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom sensor data should be retrieved</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified pacient</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, Guid pacientId);

        /// <summary>
        /// Used by the doctor, caregiver or superviser to acquire sensor data for a specific pacient and sensor types
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom sensor data should be retrieved</param>
        /// <param name="sensorTypes">The list of sensor types for which sensor data should be retrieved</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified pacient</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, Guid pacientId, List<DefinitieSenzori> sensorTypes);

        /// <summary>
        /// Used by the doctor, caregiver or superviser to acquire sensor data in a specific time interval for a specific pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom sensor data should be retrieved</param>
        /// <param name="intervalStart">The date from which sensor data should be retrieved (inclusive)</param>
        /// <param name="intervalEnd">The date up to which sensor data should be retrieved (exclusive). If this parameter is null, it will be evaluated to DateTime.Now</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified pacient and time interval</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, Guid pacientId, DateTime intervalStart, DateTime intervalEnd);

        /// <summary>
        /// Used by the doctor, caregiver or superviser to acquire sensor data in a specific time interval for a specific pacient and sensor types
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom sensor data should be retrieved</param>
        /// <param name="sensorTypes">The list of sensor types for which sensor data should be retrieved</param>
        /// <param name="intervalStart">The date from which sensor data should be retrieved (inclusive)</param>
        /// <param name="intervalEnd">The date up to which sensor data should be retrieved (exclusive). If this parameter is null, it will be evaluated to DateTime.Now</param>
        /// <returns>The list of ValoriSensori objects containing the sensor data for the specified pacient, time interval and sensor types</returns>
        List<ValoriSensori> getSensorData(Guid sessionId, Guid pacientId, List<DefinitieSenzori> sensorTypes, DateTime intervalStart, DateTime intervalEnd);

        /// <summary>
        /// Used by the pacient to add sensor data for himself
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="sensors">The list of sensor values to add</param>
        void addSensorData(Guid sessionId, List<ValoriSensori> sensors);

        /// <summary>
        /// Used by the caregiver to add sensor data for a specific pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom sensor data should be added</param>
        /// <param name="sensors">The list of sensor values to add</param>
        void addSensorData(Guid sessionId, Guid pacientId, List<ValoriSensori> sensors);

        /// <summary>
        /// Used by the pacient to acquire it's own treatments
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of Tratamente objects containing the treatments</returns>
        List<Tratamente> getTreatments(Guid sessionId);

        /// <summary>
        /// Used by the doctor, caregiver or superviser to acquire the treatments for a specific pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom the treatments should be retrieved</param>
        /// <returns>The list of Tratamente objects containing the treatments for the specified pacient</returns>
        List<Tratamente> getTreatments(Guid sessionId, Guid pacientId);

        /// <summary>
        /// Used by the doctor or superviser to update the treatments for a pacient
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <param name="pacientId">The ID of the pacient for whom the treatments should be updated</param>
        /// <param name="treatments">The list of treatments to update</param>
        void updateTreatments(Guid sessionId, Guid pacientId, List<Tratamente> treatments);

        /// <summary>
        /// Used by the doctor to acquire it's own alarm definitions
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns>The list of DeinitieAlarme objects containing the alarm definitions associated with the doctor</returns>
        List<DefiniteAlarme> getAlarmDefinitions(Guid sessionId);//utilizat pt lista de alarme,SupraveghetorForm

        /// <summary>
        /// Used by the doctor or superviser to acquire the alarms associated with it's pacients
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        /// <returns></returns>
        List<ValoriAlarme> getAlarms(Guid sessionId);//utilizat pt lista de alarme,SupraveghetorForm
    }
}
